#!/bin/sh
# postrm script for openmediavault-mysql
#
# $Id: postrm 22 2011-11-12 19:47:24Z imooreyahoo@gmail.com $
#

set -e

. /etc/default/openmediavault
. /usr/share/openmediavault/scripts/helper-functions

if [ "$1" = "purge" ]; then

	# Check for XML config
	if omv_config_exists "//services/mysql"; then
		xmlstarlet ed -P -L -d "//services/mysql" ${OMV_CONFIG_FILE}
	fi
	
	# Remove our config file
	if [ -e /etc/mysql/conf.d/openmediavault-mysql.cnf ]; then
		/bin/rm -f /etc/mysql/conf.d/openmediavault-mysql.cnf
	fi
	
fi

exit 0
